package dyyx.test1;

import com.lmax.disruptor.EventHandler;

public class DataConsumer implements EventHandler<Data> {

	private long startTime;
	private int i;

	public DataConsumer() {
		this.startTime = System.currentTimeMillis();
	}

	@Override
	public void onEvent(Data data, long seq, boolean bool) throws Exception {
		i++;
		if (i == Consts.COUNT) {
			long endTime = System.currentTimeMillis();
			System.out.println("Disruptor costTime = " + (endTime - startTime) + "ms");
		}
	}
}
